import api from "@/util/api.js"

async function  findById(id){
    let resp = await api({
        url:"/rbac-api/api/v1/role_perms/id/"+id,
        method:"get",
    })
    return resp;
}
async function findRPAll(params){
    let resp = await api({
        url:"/rbac-api/api/v1/role_perms",
        method:"get",
         params
    })
    return resp;
}
async function saveRolePerm(rolePerm){
    let resp = await api({
        url:"/rbac-api/api/v1/role_perms/save",
        method:"post",
        data:rolePerm
    })
    return resp;
}
async function updateRolePerm(rolePerm){
    let resp = await api({
        url:"/rbac-api/api/v1/role_perms/update",
        method:"put",
        data:rolePerm
    })
    return resp;
}
async function deleteRolePermById(ids){
    let resp = await api({
        url:"/rbac-api/api/v1/role_perms/delete",
        method:"delete",
        data:ids
    })
    return resp;
}

export {
    findById,
    findRPAll,
    saveRolePerm,
    updateRolePerm,
    deleteRolePermById
}